package addon.w3.mdx.com;

import java.io.IOException;

import addon.w3.mdx.MDXCOM;
import addon.w3.mdx.LEDataInputStream;
import addon.w3.mdx.MDXException;
/**
--PTYP						// Not sure of the function of these.
	long	nptyps;				//   PTYP seems to be a way to indicate the type 
	long	primType[nptyps];		//   of primitive (4) for each group indicated
--PCNT						//   in PCNT. And each value in PCNT is how 
	long	npcnts;				//   many verts in a face (3).
	long	primCount[npcnts];

 * @author madjk
 *
 */
public class MDXPCNTCOM extends MDXCOM {
	int length = -1;
	int primCount[] = null;
	
	public String getTag() {
		return "PCNT";
	}
	
	public void _decode(LEDataInputStream ins) throws IOException, MDXException {
		length = ins.readInt();
		primCount = new int[length];
		for (int i = 0; i < primCount.length; i++) {
			primCount[i] = ins.readInt();
		}
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("TAG : "+getTag());
		sb.append("\n\tILEN : "+length);
		if(primCount != null && primCount.length > 0) sb.append("\n\tPRIMCOUNT[] : "+primCount.length);
		return sb.toString();
	}

	@Override
	public boolean isImplicitTag() {
		// TODO Auto-generated method stub
		return true;
	}
}
